<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function Person(role) {
            function SuperAdmin() {
                this.name = 'SuperAdmin'
                this.qx = ['首页', '列表页', '购物车', '管理', '系统设置', '人员分配']
            }
            function Admin() {
                this.name = 'Admin'
                this.qx = ['首页', '列表页', '购物车', '管理', '系统设置']
            }
            function Vip() {
                this.name = 'Vip'
                this.qx = ['首页', '列表页', '购物车']
            }
            switch (role) {
                case 'SuperAdmin':
                    return new SuperAdmin()
                    break
                case 'Admin':
                    return new Admin()
                    break
                case 'Vip':
                    return new Vip()
                    break
            }
        }
    </script>
</body>

</html>